<%@ page import="java.util.Properties" %>
<%@ page import="java.io.InputStream" %>
<%@ page import="java.io.FileInputStream" %><%--
  Created by IntelliJ IDEA.
  User: Lenovo
  Date: 2025-08-03
  Time: 8:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <%
        String name=request.getParameter("username");
        String pwd=request.getParameter("password");
        String path = application.getRealPath("/user.properties");
        InputStream is=new FileInputStream(path);
        Properties p=new Properties();
        p.load(is);
        if(name.equals(p.getProperty("username"))&&
        pwd.equals(p.getProperty("password"))){
         session.setAttribute("username",name);
            %>

        <jsp:forward page="index.jsp"/>
    <%
        }
        else{
            %>
       <jsp:forward page="login.jsp"/>
    <%
        }
    %>
</body>
</html>
